package cn.tedu.xuehaoyuandemo;

import cn.tedu.xuehaoyuandemo.controller.Redisson;
import org.redisson.config.Config;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class XueHaoYuanDemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(XueHaoYuanDemoApplication.class, args);
    }

    //分布式锁要的配置类
    //    @Bean
//    public Redisson redisson() {
//        //此为单价
//        Config config =new Config();
//        config.useSingleServer().setAddress("redis://localhost:6379").setDatabase(0);
//        //config.setLockWatchdogTimeout(10000); //设置分布式锁watch dog超时时间
//        return     (Redisson) Redisson.create(config);
//    }
}
